<?php
include("../inc/global.inc");
include("../steps.php");
$url="favorites.php";
$thepage=$_GET['page']?$_GET['page']:1;
$maxpage=20;
if($_GET['del_act']){
$urls=$_SERVER['HTTP_REFERER'];
mysql_query("delete from job_favorites where member_id='$_COOKIE[job_user_id]' and id='".$_GET['del_id']."'");
echo "<script>location='".$urls."'</script>";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>我的收藏夹-三帝招聘网</title>
<link href="../css/body.css" rel="stylesheet" type="text/css"/>
<link href="css/head.css" rel="stylesheet" type="text/css"/>
<link href="css/search_list.css" rel="stylesheet" type="text/css"/>
<link href="../css/foot.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<?php include("../inc/top.php");?>
<div class="menuBox1">
<a href="/member/">管理中心</a>
<a href="/member/show.php">我的简历</a>
<a href="/member/search_manage.php">我的搜索器</a>
<a href="/member/favorites.php" class="hover">收藏夹</a>
<a href="/member/cqjob.php">发件夹</a>
<a href="/member/inbox.php">收件夹</a>
<div class="onl"></div>
</div>
<div id="mian">
  <div id="box">
  <div class="JobBox sideyellow backyellow">
<div class="mian_Co">
  <div class="title size14 topside6"><strong>职位收藏夹</strong></div>
  <div class="title1"></div>
  <table width="99%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="table">
    <tbody>
		<tr>
		  <td width="100%" height="46"><table border="0" cellpadding="0" cellspacing="1" bgcolor="#FFF5EC" id="main_body" style="border:1px #ccc solid">
              <tr>
                <td width="54" height="29" align="center" bgcolor="#FFF5EC"><strong>编号</strong></td>
                <td width="249" bgcolor="#FFF5EC"><b>&nbsp;职位名称</b></td>
                <td width="324" bgcolor="#FFF5EC"><b>公司名称</b></td>
                <td width="110" align="center" bgcolor="#FFF5EC"><b>职位有效期</b></td>
                <td width="83" align="center" bgcolor="#FFF5EC"><b>收藏时间</b></td>
                <td width="121" align="center" bgcolor="#FFF5EC"><b>操作</b></td>
              </tr>
      <?php
        $sql="select job_favorites.id,job_favorites.post_id,job_favorites.favorite_addtime,job_post.member_id,job_post.job_effe,job_post.job_title,job_post.job_addtime from job_favorites inner join job_post on (job_favorites.post_id=job_post.id) where job_favorites.member_id='$_COOKIE[job_user_id]' order by job_favorites.id desc limit ".($thepage-1)*$maxpage.",$maxpage";
        $rs=@mysql_query($sql);
		$i=1;
        while($row=@mysql_fetch_array($rs)){
		  $rs2=@mysql_query("select * from member where id='".$row['member_id']."'");
		  $row2=@mysql_fetch_array($rs2);
      ?>			  
              <tr>
                <td height="30" align="center" bgcolor="#FFFFFF"><?=$i?></td>
                <td height="30" bgcolor="#FFFFFF"><a href="/jobpost/<?=$row[post_id]?>.cfm" style="color:#0033FF;" target="_blank"><?=$row[job_title]?></a></td>
                <td bgcolor="#FFFFFF"><a href="/jobcom/<?=$row2['id']?>/" target="_blank"><?=$row2[m_cname]?></a></td>
                <td align="center" bgcolor="#FFFFFF"><?=date("Y-m-d",strtotime($row[job_addtime]."+".$row[job_effe]."day"))?></td>
                <td align="center" bgcolor="#FFFFFF"><?=date("Y-m-d",strtotime($row[favorite_addtime]))?></td>
                <td align="center" bgcolor="#FFFFFF"><a href="favorites.php?del_act=ok&del_id=<?=$row['id']?>" onclick="return del()" style="color:#0033FF;">删除</a> | <a href="/jobpost/<?=$row[post_id]?>.cfm" style="color:#0033FF;" target="_blank">查看</a></td>
              </tr>
		<?php $i++;}
		$totalrecord=mysql_num_rows(mysql_query("select job_favorites.id,job_favorites.post_id,job_favorites.favorite_addtime,job_post.member_id,job_post.job_effe,job_post.job_title,job_post.job_addtime from job_favorites inner join job_post on (job_favorites.post_id=job_post.id) where job_favorites.member_id='$_COOKIE[job_user_id]'"));
        $totalpage=ceil($totalrecord/$maxpage);
       ?>	  
            </table></td>
		  </tr><form name="pageform" method="get" action="" onSubmit="return onCheckPage()">
		<tr>
		  <td height="46" align="center">
		  <table width="99%" height="40" border="0" cellpadding="0" cellspacing="0" id="main_body">
		  
            <tr>
              <td align="right"><script language="javascript">
<!--
function showPageLink(sUrl,iPage,iCount){
	var i;
	i=Math.max(1,iPage-1);
	document.write("<a href=\"" + sUrl + "1\">第一页</a> ");
	document.write("<a href=\"" + sUrl + i + "\">上一页</a> ");
	for(i=Math.max(1,iPage-8);i<iPage;i++){
		document.write("<a href=\""+sUrl + i + "\"><b>" + i + "</b></a> ");
	}
	document.write("<font color='#ff3333'><b>" + iPage + "</b></font> ");
	for(i=iPage+1;i<=Math.min(iCount,iPage+8);i++){
		document.write("<a href=\""+sUrl + i + "\"><b>" + i + "</b></a> ");
	}
	i=Math.min(iCount,iPage+1);
	if(iCount>iPage+8) document.write("<span style='font-size:8px'>···</span> ");
	document.write("<a href=\"" + sUrl + i + "\">下一页</a> ");
	document.write("<a href=\"" + sUrl + iCount + "\">最后一页</a> ");
}
showPageLink("<?=$url?>?page=",<?=$thepage?>,<?=$totalpage?>);
//-->
</script>&nbsp;&nbsp;&nbsp;共<?=$totalpage?>页　到
<input type="text" name="page"  size="3" maxlength="5">
页
<input type="submit" value="确定" class="but">
</td>
              </tr>
		
<script language="javascript"> 
function onCheckPage(){
var page = parseInt(document.pageform.page.value); 
if(isNaN(page)){
alert("请输入数字(1,<?=$totalpage?>)");
return false; 
}
if(page ><?=$totalpage?>){
alert("请输入数字(1,<?=$totalpage?>)");
return false;
}
}
</script>
          </table></td>
		  </tr>
</form>
    </tbody>
  </table>
</div>
</div>
<div class="onl"></div>
<div class="onl"></div>
</div>
<div class="onl"></div>
</div>
<?php include("../inc/foot.php");?>
</body>
</html>
<script language="javascript">
function del(){
if(confirm("警告：删除该信息？"))
	return true;
	else
	return false;
	}
</script>